package com.itheima.test5;

public class Test {


    public static void main(String[] args) {
        //创建父类变量   指向 子类的对象
        Fu fu= new Zi1();
        fu.eat();//吃两大碗
        fu=new Zi2();
        fu.eat();//吃五大碗
        if(fu instanceof Zi2){
            Zi2 zi2=(Zi2) fu;
            zi2.drink();

        }



    }
}
